# Makefile for the project

# default: all

CONFIG_FILE_NAME = TEST-X86-gcc-linux-k2#Example-gcc-linux-x86-temp1#TEST-X86-gcc-linux#-lk1
CASE_NAME = all#621.wrf_s#623.xalancbmk_s#all#507.cactuBSSN_r#607.cactuBSSN_s#507.cactuBSSN_r#all # fprate fpspeed intrate intspeed  s
CASE_SIZE = ref	# ref, test, train
CASE_TUNE = base # base, peak
CPU_NUM= 8



all: scrub run

shrc:
	source shrc

setup:
	time runcpu --config=${CONFIG_FILE_NAME} \
		--action=setup \
		--size=${CASE_SIZE} \
		--define build_ncpus=${CPU_NUM} \
		--tune=${CASE_TUNE} \
		${CASE_NAME}
run:
	time runcpu --config=${CONFIG_FILE_NAME} \
		--action=run \
		--size=${CASE_SIZE} \
		--define build_ncpus=${CPU_NUM} \
		--tune=${CASE_TUNE} \
		${CASE_NAME}
scrub:
	time runcpu --config=${CONFIG_FILE_NAME} \
		--action=scrub \
		--size=${CASE_SIZE} \
		--define build_ncpus=${CPU_NUM} \
		--tune=${CASE_TUNE} \
		${CASE_NAME}

gcc: #快速切换GCC版本
	sudo update-alternatives --config gcc

deleteall: delete deletecfg deleteresult deletetmp
delete:
	rm -Rf ${SPEC}/benchspec/C*/*/run
	rm -Rf ${SPEC}/benchspec/C*/*/build
	rm -Rf ${SPEC}/benchspec/C*/*/exe 

deletecfg:
	rm -Rf ${SPEC}/config/*.cfg.*

deleteresult:
	rm -Rf ${SPEC}/result/*

deletetmp:
	rm -Rf ${SPEC}/tmp/*